{% extends "view/admin/ext_admin.html" %}
{% block extadmin %}
<section class="panel panel-default">
    <header class="panel-heading text-right bg-light  clearfix">
        <ul class="nav nav-tabs pull-left">
            <li class="active"><a  href="/{{ctx.controller}}/index">{{controller.meta_title}}</a></li>
            <li class=""><a  href="/{{ctx.controller}}/temp">模板设置</a></li>
        </ul>
        <!--<span class="hidden-sm"><a href="/{{http.module}}/{{http.controller}}/ajaxadd" class="text-info " data-toggle="ajaxModal">添加友情链接</a></span>-->
    </header>
    <div class="row wrapper">

        <div class="col-sm-12 m-b-xs">
            <a href="/{{ctx.controller}}/addspace" class="btn btn-s-md btn-primary" data-toggle="ajaxModal">添加广告位</a>
            <a href="/{{ctx.controller}}/adcache" class="btn btn-s-md btn-dark ajax-get">更新广告缓存</a>
        </div>
    </div>
    <div class="table-responsive">
        <table class="table table-striped b-t b-light">
            <thead>
            <tr>
                <th style="width:20px;"><label class="checkbox m-n i-checks"><input type="checkbox"><i></i></label></th>
                <th style="">广告位名称</th>
                <th class="">广告位类型</th>
                <th class="">广告位尺寸</th>
                <th class="">广告数</th>
                <th class="">广告位描述</th>
                <th >操作</th>
            </tr>
            </thead>
            <tbody>
            {% for item in list %}
            <tr>
                <td><label class="checkbox m-n i-checks"><input class="ids" type="checkbox" name="ids" value="{{item.spaceid}}"><i></i></label></td>
                <td>{{item.name}}</td>
                <td>{{item.type}}</td>
                <td>{{item.width}}*{{item.height}}</td>
                <td>{{item.items}}</td>
                <td>{{item.description}}</td>
                <td>
                    <a href="/{{ctx.controller}}/showad/?spaceid={{item.spaceid}}" class="text-info" target="_blank">预览</a>
                    <a href="/{{ctx.controller}}/code/?spaceid={{item.spaceid}}" class="text-info" data-toggle="ajaxModal">调用代码</a>
                    <a href="/{{ctx.controller}}/adlist/?spaceid={{item.spaceid}}" class="text-info" >广告列表</a>
                    <a href="/{{ctx.controller}}/editspace/?spaceid={{item.spaceid}}" class="text-info" data-toggle="ajaxModal">修改</a>
                    <a href="/{{ctx.controller}}/delspace/?ids={{item.spaceid}}" class="confirm ajax-get text-info">删除</a>
                    <a href="/{{ctx.controller}}/addad/?spaceid={{item.spaceid}}" class="text-info">添加广告</a>
                </td>


            </tr>
            {% else %}
            <tr><td colspan="8"><div class="alert alert-warning alert-block">
                <button data-dismiss="alert" class="close" type="button">×</button>
                <p>暂无数据</p>
            </div></td></tr>

            {% endfor %}


            </tbody>
        </table>
    </div>
    <footer class="panel-footer">
        <div class="row">

            <div class="col-sm-6 text-center-xs">
                <div class="btn-group">
                    <a href="/{{ctx.controller}}/delspace" class="btn btn-default ajax-post confirm" target-form="ids">删除选定广告位</a>
                </div>
            </div>

            <div class="col-sm-6 text-right text-center-xs">
                {{pagerData | safe}}
            </div>
        </div>
    </footer>
</section>

{% endblock %}
